import { generic } from './generic.js';
generic();
const bgc = document.querySelector('.filterheader');
const images = [...document.querySelectorAll('.image')];
console.log(images);
window.addEventListener('load', async () => {
  const { data } = await axios({
    // 请求地址
    url: 'http://website.bluej.cn/api/carouselGroup/get',
    // 请求方式
    method: 'GET',
    params: {
      carouselGroupId: '1354',
    },
  });
  const pictureAll = data.data.Carousels;
  console.log(pictureAll);
  bgc.style.backgroundImage = `url(${pictureAll[0].url})`;
  images[0].innerHTML = `
    <img src="${pictureAll[1].url}" alt=""  />
  `;
  for (let i = 1; i <= pictureAll.length - 2; i++) {
    images[i].innerHTML = `
      <img src="${pictureAll[i + 1].url}" alt="" />
    `;
  }
});
